package routers

import (
	"github.com/gin-gonic/gin"
	"task-server-gin/controllers"
)

func TaskRouterInit(r *gin.Engine) {
	taskRouters := r.Group("/spider_manage")

	{
		// reconnect database
		taskRouters.GET("/connect", controllers.TaskController{}.Connect)

		// task
		taskRouters.GET("/taskOne/taskOneGetOff", controllers.TaskController{}.GetFreshTask)
		taskRouters.GET("/taskOne/taskOneUpdateFinish", controllers.TaskController{}.UpdateTaskState)

		// record
		taskRouters.POST("/downloadRecord/downloadRecordInsert", controllers.TaskController{}.InsertDownloadRecord)
		taskRouters.POST("/downloadRecord/downloadRecordGet", controllers.TaskController{}.GetDownloadRecord)

		// save info
		taskRouters.POST("/video/videoInsertOne", controllers.TaskController{}.InsertVideoInfo)
		taskRouters.POST("/vUser/vUserInsertOne", controllers.TaskController{}.InsertAuthorInfo)

	}
}
